#include "Udp_server.hpp"
#include"Dictionary.hpp"
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        cerr << "Usage: " << argv[0] << " localport" << std::endl;
        Die(USAGE_ERR);
    }

    uint16_t port =stoi(argv[1]);

    ENABLE_CONSOLE_LOG();
    shared_ptr<Dictionary> dict=make_shared<Dictionary>();
    unique_ptr<Udp_server> svr_uptr = make_unique<Udp_server>([&dict](const string &word){
        return dict->Translate(word);
    }, port);
    svr_uptr->InitServer();
    svr_uptr->start();

    return 0;
}